package com.zekdot.registerclient.service.mq;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Create by zekdot on 20-4-12.
 */
@Configuration
public class EnrollRabbitConfig {
    @Bean
    public Queue EnrollQueue(){
        return new Queue("EnrollQueue",true);
    }

    @Bean
    DirectExchange EnrollExchange(){
        return new DirectExchange("EnrollExchange");
    }

    @Bean
    Binding bindingDirect(){
        return BindingBuilder.bind(EnrollQueue()).to(EnrollExchange()).with("EnrollRouting");
    }
}